package com.my.ddd_sample_collections.aggregate_change_tracking.abstract_domain;

import com.my.ddd_sample_collections.aggregate_change_tracking.repository_framework.DomainObjectSupport;
import lombok.experimental.SuperBuilder;

import java.util.Objects;

@SuperBuilder
public class AbstractSimpleDO extends DomainObjectSupport {
    private String email;
    private String street;

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        if (!Objects.deepEquals(this.email, email)) {
            track(this, this.email, "email", email);
        }
        this.email = email;
    }

    public String getStreet() {
        return street;
    }

    public void setStreet(String street) {
        if (!Objects.deepEquals(this.street, street)) {
            track(this, this.street, "street", street);
        }
        this.street = street;
    }
}
